<template>
  <el-container style="height: 100vh; border: 1px solid #eee; box-sizing:border-box;">
    <el-aside width="200px" style="background-color: #545C64">
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
        router
      >
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>首页</span>
          </template>
            <el-menu-item index="/">概览</el-menu-item>
        </el-submenu>
        <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-truck"></i>
              <span>站点</span>
            </template>
            <el-menu-item index="/station">车站管理</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-truck"></i>
              <span>火车</span>
            </template>
            <el-menu-item index="/train">火车管理</el-menu-item>
          </el-submenu>
        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-truck"></i>
            <span>订单</span>
          </template>
          <el-menu-item index="/ticketList">订单管理</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>查看</el-dropdown-item>
            <el-dropdown-item>新增</el-dropdown-item>
            <el-dropdown-item>删除</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <span>王小虎</span>
      </el-header>

      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<style>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>

<script>
export default {
  data() {
    return {

    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>
